﻿<UserControl x:Class="Northwind.UI.WPF.OrderWizardCustomerView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="360" d:DesignWidth="650"
             >    
    <DockPanel>
        <Border DockPanel.Dock="Top" Padding="10" 
                Margin="6,6,6,0"
                CornerRadius="5"
                Background="{StaticResource mainBlueBrush}">
            <TextBlock Text="Enter Customer Information"
                    Foreground="White" FontWeight="Bold"
                    FontSize="16"
                    HorizontalAlignment="Center"  />            
        </Border>    
    <Grid Margin="5,3,5,10">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0.65*" /> 
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid Grid.Column="0" Margin="4,7,4,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <ListBox ItemsSource="{Binding Customers}"
                         SelectedValuePath="CustomerID"
                         SelectedItem="{Binding SelectedCustomer}"                 
                         x:Name="lstBoxCustomers"
                         Grid.Row="0" >
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <ContentControl>
                                <TextBlock Text="{Binding CompanyName}" />
                            </ContentControl>
                        </DataTemplate>
                    </ListBox.ItemTemplate>                    
                </ListBox>
            </Grid>
        <StackPanel Grid.Column="1">
            <GroupBox Header="Details" IsEnabled="False"
                  MinHeight="240"         
                  DataContext="{Binding ElementName=lstBoxCustomers, Path=SelectedItem}"
                  >
                <Grid Margin="4">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="6" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>

                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="30" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="30" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="30" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="30" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Label Content="Company Name:"
                       HorizontalAlignment="Right" />
                    <TextBox Text="{Binding CompanyName, 
                         UpdateSourceTrigger=PropertyChanged,
                         Mode=OneWay}"
                         Grid.Column="2" />
                    <Label Content="Contact Name:"
                       Grid.Row="1"
                       HorizontalAlignment="Right" />
                    <TextBox Text="{Binding ContactName, 
                         UpdateSourceTrigger=PropertyChanged,
                         Mode=OneWay}"
                         Grid.Row="1"
                         Grid.Column="2" />
                    <Label Content="Phone Number:"
                       Grid.Row="2"
                       HorizontalAlignment="Right" />
                    <TextBox Text="{Binding Phone, 
                         UpdateSourceTrigger=PropertyChanged,
                         Mode=OneWay}"
                         Grid.Row="2"
                         Grid.Column="2" />
                    <Label Content="Address:"
                       Grid.Row="3"
                       HorizontalAlignment="Right" />
                    <TextBox Text="{Binding Address, 
                         UpdateSourceTrigger=PropertyChanged,
                         Mode=OneWay}"
                         Grid.Row="3"
                         Grid.Column="2" />
                    <Label Content="City:"
                       Grid.Row="4"
                       HorizontalAlignment="Right" />
                    <TextBox Text="{Binding City, 
                         UpdateSourceTrigger=PropertyChanged,
                         Mode=OneWay}"
                         Grid.Row="4"
                         Grid.Column="2" />
                    <Label Content="Region:"
                       Grid.Row="5"
                       HorizontalAlignment="Right" />
                    <TextBox Text="{Binding Region, 
                         UpdateSourceTrigger=PropertyChanged,
                         Mode=OneWay}"
                         Grid.Row="5"
                         Grid.Column="2" />
                    <Label Content="Country:"
                       Grid.Row="6"
                       HorizontalAlignment="Right" />
                    <TextBox Text="{Binding Country, 
                         UpdateSourceTrigger=PropertyChanged,
                         Mode=OneWay}"
                         Grid.Row="6"
                         Grid.Column="2" />
                    <Label Content="Zip:"
                       Grid.Row="7"
                       HorizontalAlignment="Right" />
                    <TextBox Text="{Binding PostalCode, 
                         UpdateSourceTrigger=PropertyChanged,
                         Mode=OneWay}"
                         Grid.Row="7"
                         Grid.Column="2" />                   
                </Grid>
            </GroupBox>
            <Button Content="Next" Command="{Binding ShowNextWizardChild}" 
                    Width="50" HorizontalAlignment="Right" Margin="0,6,5,5" />
        </StackPanel>
    </Grid>
    </DockPanel>
</UserControl>
